package com.glh.javalogic.chapter4.doubleedged;


/**
 * <pre>
 *     author : 高磊华
 *     e-mail : 984992087@qq.com
 *     time   : 2018/08/18
 *     desc   : 父类 (继承是把双刃剑)
 *     version: 1.0
 * </pre>
 */

public class BaseV1 {

    private static final int   MAX_NUM = 1000;
    private              int[] arr     = new int[MAX_NUM];
    private int count;

    public void add(int number) {
        if (count < MAX_NUM) {
            arr[count++] = number;
        }
    }

    public void addAll(int[] numbers) {
        for (int num : numbers) {
//            add(num);

            if (count < MAX_NUM) {
                arr[count++] = num;
            }

        }
    }
}